﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SimpleRentz
{
	public partial class Rentz : Form
	{
		public Rentz()
		{
			InitializeComponent();
		}

		private void exitToolStripMenuItem_Click(object sender, EventArgs e)
		{
			this.Close();
		}

		private void createServerToolStripMenuItem_Click(object sender, EventArgs e)
		{
			CreateServerDialog dlg = new CreateServerDialog();
			dlg.Port = 8080;
			dlg.Password = "";
			DialogResult res = dlg.ShowDialog(this);

			if (res == System.Windows.Forms.DialogResult.OK)
			{
				//TODO: start server
			}

			dlg.Dispose();
		}

		private void joinServerToolStripMenuItem_Click(object sender, EventArgs e)
		{
			JoinServerDialog dlg = new JoinServerDialog();
			dlg.Port = 8080;
			dlg.Password = "";
			dlg.Server = "127.0.0.1";
			DialogResult res = dlg.ShowDialog(this);

			if (res == System.Windows.Forms.DialogResult.OK)
			{
				//TODO: join server
			}
            
			dlg.Dispose();
		}

		private void Rentz_Load(object sender, EventArgs e)
		{
            int[] pachetCarti = new int[52];
            for (int i = 0; i < pachetCarti.Length; i++)
            {
                pachetCarti[i] = 101 + i;
            }

			pbRentz.Image = new Bitmap(pbRentz.Width, pbRentz.Height);
			Graphics gr = Graphics.FromImage(pbRentz.Image);

			gr.Clear(System.Drawing.Color.Black);

			//gr.DrawImage(Properties.Resources._32_bit, new Point(100, 100));\
			//gr.DrawImage(Properties.Resources.accordion, new Point(110, 110));

			gr.Dispose();
		}

		private void pbRentz_Click(object sender, EventArgs e)
		{
			MouseEventArgs me = (MouseEventArgs)e;

			if (me.Button == System.Windows.Forms.MouseButtons.Left)
			{
				//e.X and e.Y
			}
		}
	}
}
